package com.weibo.demos.web.Mapper;


import com.weibo.demos.web.entity.UserVO;
import com.weibo.demos.web.entity.userLoginDTO;
import com.weibo.demos.web.entity.userRegDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {


    /**
     * 用户注册
     * @return
     */
    @Insert("insert into user(username,password,nickname,created) values(#{username},#{password},#{nickname},now())")
    int addUser(userRegDTO user);


    /**
     * 查询用户名是否存在
     * @return
     */
    @Select("select username,password from user where username=#{username}")
    userRegDTO selectUserName(userRegDTO user);


    @Select("select * from user where username= #{username}")
    UserVO selectUserName1(userLoginDTO user);
}
